package sample3.provider.dml;

import android.content.ContentResolver;
import android.content.ContentValues;
import android.net.Uri;

/**
 * <pre>
 * ...
 * SqliteInsertBuilder sql = new SqliteInsertBuilder(uri);
 * sql.addContentValue("name", "abcd");
 * Uri newUri = sql.insert(getContentResolver());
 * ...
 * </pre>
 */
public class SqliteInsertBuilder extends AbsDmlBuilder {
	ContentValues mValues = new ContentValues();

	public SqliteInsertBuilder(Uri uri) {
		super(uri);
	}

	public void clear() {
		mValues.clear();
	}

	public void addContentValue(String key, Boolean value) {
		mValues.put(key, value);
	}

	public void addContentValue(String key, Byte value) {
		mValues.put(key, value);
	}

	public void addContentValue(String key, byte[] value) {
		mValues.put(key, value);
	}

	public void addContentValue(String key, Double value) {
		mValues.put(key, value);
	}

	public void addContentValue(String key, Float value) {
		mValues.put(key, value);
	}

	public void addContentValue(String key, Integer value) {
		mValues.put(key, value);
	}

	public void addContentValue(String key, Long value) {
		mValues.put(key, value);
	}

	public void addContentValue(String key, Short value) {
		mValues.put(key, value);
	}

	public void addContentValue(String key, String value) {
		mValues.put(key, value);
	}

	public Uri insert(ContentResolver contentResolver) {
		return contentResolver.insert(mUri, mValues);
	}

	// -----------Unsupported method
	public SqliteWhereBuilder addAndWhere(SqliteWhereBuilder... otherWheres) {
		throw new UnsupportedOperationException();
	}

	public SqliteWhereBuilder addOrWhere(SqliteWhereBuilder... otherWheres) {
		throw new UnsupportedOperationException();
	}

	public SqliteWhereBuilder addAndEquals(String column, String arg) {
		throw new UnsupportedOperationException();
	}

	public SqliteWhereBuilder addAndNotEquals(String column, String arg) {
		throw new UnsupportedOperationException();
	}

	public SqliteWhereBuilder addAndIn(String column, String... args) {
		throw new UnsupportedOperationException();
	}

	public SqliteWhereBuilder addAndNotIn(String column, String... args) {
		throw new UnsupportedOperationException();
	}

	public SqliteWhereBuilder addAndLike(String column, String arg) {
		throw new UnsupportedOperationException();
	}

	public SqliteWhereBuilder addAndNotLike(String column, String arg) {
		throw new UnsupportedOperationException();
	}

	public SqliteWhereBuilder addAndIsNull(String column) {
		throw new UnsupportedOperationException();
	}

	public SqliteWhereBuilder addAndIsNotNull(String column) {
		throw new UnsupportedOperationException();
	}

	public SqliteWhereBuilder addOrEquals(String column, String arg) {
		throw new UnsupportedOperationException();
	}

	public SqliteWhereBuilder addOrNotEquals(String column, String arg) {
		throw new UnsupportedOperationException();
	}

	public SqliteWhereBuilder addOrIn(String column, String... args) {
		throw new UnsupportedOperationException();
	}

	public SqliteWhereBuilder addOrNotIn(String column, String... args) {
		throw new UnsupportedOperationException();
	}

	public SqliteWhereBuilder addOrLike(String column, String arg) {
		throw new UnsupportedOperationException();
	}

	public SqliteWhereBuilder addOrNotLike(String column, String arg) {
		throw new UnsupportedOperationException();
	}

	public SqliteWhereBuilder addOrIsNull(String column) {
		throw new UnsupportedOperationException();
	}

	public SqliteWhereBuilder addOrIsNotNull(String column) {
		throw new UnsupportedOperationException();
	}

	public SqliteWhereBuilder addAndEquals(String column, Number arg) {
		throw new UnsupportedOperationException();
	}

	public SqliteWhereBuilder addAndNotEquals(String column, Number arg) {
		throw new UnsupportedOperationException();
	}

	public SqliteWhereBuilder addAndIn(String column, Number... args) {
		throw new UnsupportedOperationException();
	}

	public SqliteWhereBuilder addAndNotIn(String column, Number... args) {
		throw new UnsupportedOperationException();
	}

	public SqliteWhereBuilder addAndLessThan(String column, Number arg) {
		throw new UnsupportedOperationException();
	}

	public SqliteWhereBuilder addAndGreaterThan(String column, Number arg) {
		throw new UnsupportedOperationException();
	}

	public SqliteWhereBuilder addAndLessThanOrEquals(String column, Number arg) {
		throw new UnsupportedOperationException();
	}

	public SqliteWhereBuilder addAndGreaterThanOrEquals(String column, Number arg) {
		throw new UnsupportedOperationException();
	}

	public SqliteWhereBuilder addAndBetween(String column, Number lessThan, Number greaterThan) {
		throw new UnsupportedOperationException();
	}

	public SqliteWhereBuilder addAndNotBetween(String column, Number lessThan, Number greaterThan) {
		throw new UnsupportedOperationException();
	}

	public SqliteWhereBuilder addOrEquals(String column, Number arg) {
		throw new UnsupportedOperationException();
	}

	public SqliteWhereBuilder addOrNotEquals(String column, Number arg) {
		throw new UnsupportedOperationException();
	}

	public SqliteWhereBuilder addOrIn(String column, Number... args) {
		throw new UnsupportedOperationException();
	}

	public SqliteWhereBuilder addOrNotIn(String column, Number... args) {
		throw new UnsupportedOperationException();
	}

	public SqliteWhereBuilder addOrLessThan(String column, Number arg) {
		throw new UnsupportedOperationException();
	}

	public SqliteWhereBuilder addOrGreaterThan(String column, Number arg) {
		throw new UnsupportedOperationException();
	}

	public SqliteWhereBuilder addOrLessThanOrEquals(String column, Number arg) {
		throw new UnsupportedOperationException();
	}

	public SqliteWhereBuilder addOrGreaterThanOrEquals(String column, Number arg) {
		throw new UnsupportedOperationException();
	}

	public SqliteWhereBuilder addOrBetween(String column, Number lessThan, Number greaterThan) {
		throw new UnsupportedOperationException();
	}

	public SqliteWhereBuilder addOrNotBetween(String column, Number lessThan, Number greaterThan) {
		throw new UnsupportedOperationException();
	}

	public String getWhere() {
		throw new UnsupportedOperationException();
	}

	public String[] getWhereArgs() {
		throw new UnsupportedOperationException();
	}
}
